var e = require;
var t = module;
var o = exports;
var n;
Object.defineProperty(o, "__esModule", {value: !0});
var r = cc._decorator,
    s = r.ccclass,
    c =
        (r.property,
        (function (e) {
            function t() {
                var t = (null !== e && e.apply(this, arguments)) || this;
                return (t._bannerTemplate = null), (t.boxPortalAd = null), (t.boxBannerAd = null), t;
            }
            return (
                __extends(t, e),
                (t.prototype.init = function (e) {
                    (this._config = e),
                        (this._bannerCode = "bd29797c45474dbf8c4a1a81f38a80eb"),
                        (this._boxPortalCode = e.boxbanner_code);
                }),
                (t.prototype.start = function () {}),
                (t.prototype.initBoxBannerAd = function () {
                    qg.createBoxBannerAd
                        ? ((this.boxBannerAd = qg.createBoxBannerAd({posId: this._bannerCode})),
                          this.boxBannerAd.onError(function (e) {
                              console.log("盒子横幅广告加载失败", e);
                          }),
                          this.boxBannerAd.show().then(function () {
                              console.log("show success");
                          }))
                        : console.log("暂不支持互推盒子相关 API");
                }),
                (t.prototype.initBoxPortalAd = function (e) {
                    console.log("_boxPortalCode = ", this._boxPortalCode),
                        qg.createBoxPortalAd
                            ? ((this.boxPortalAd = qg.createBoxPortalAd({
                                  posId: this._boxPortalCode,
                                  image: "/assets/image/icon_moregame.png",
                                  marginTop: e
                              })),
                              this.boxPortalAd.onError(function (e) {
                                  console.log("盒子九宫格广告加载失败", e);
                              }),
                              this.boxPortalAd.onClose(function () {
                                  console.log("close"),
                                      (this.boxPortalAd && this.boxPortalAd.isDestroyed) || this.boxPortalAd.show();
                              }),
                              this.boxPortalAd.show().then(function () {
                                  console.log("show success");
                              }))
                            : console.log("暂不支持互推盒子相关 API");
                }),
                (t.prototype.closeBoxBanner = function () {
                    null != this.boxBannerAd && this.boxBannerAd.destroy();
                }),
                (t.prototype.closeBoxPortalAd = function () {
                    null != this.boxPortalAd &&
                        (console.log("close 关闭 悬浮广告"),
                        (this.boxPortalAd.isDestroyed = !0),
                        this.boxPortalAd.destroy());
                }),
                __decorate([s], t)
            );
        })(cc.Component));
o.default = c;
